class Singleton {
    constructor() {
        if (Singleton.instance) {
            return Singleton.instance;
        }
        
        // 数据库配置示例
        this.dbUrl = null;
        this.username = null;
        Singleton.instance = this;
    }
    
    setDatabaseConfig(dbUrl, username) {
        this.dbUrl = dbUrl;
        this.username = username;
    }
    
    connect() {
        console.log(`使用配置连接到数据库: ${this.dbUrl}`);
    }
}

// 导出单例实例
const instance = new Singleton();
Object.freeze(instance);
export default instance; 